from logic_rule.role_misplacement_check import read_and_check_file
from logic_rule.court_name_check import validate_court_name_new
from logic_rule.punctuation_check import check_punctuation_rules
from logic_rule.citation_check import check_legal_citation
from logic_rule.dates_check import check_date_logic
from enetity_extraction.test import get_extraction_results

def why_rule_check(article_sections, extract_sections):
    result = []
    # 角色错乱
    result.extend(read_and_check_file(article_sections, extract_sections))

    # 法院名称校验
    result.extend(validate_court_name_new(article_sections, extract_sections)['data'])

    # 标点符号校验
    result.extend(check_punctuation_rules(article_sections, extract_sections)['data'])

    # 引用校验
    result.extend(check_legal_citation(article_sections, extract_sections))

    # 日期校验
    result.extend(check_date_logic(article_sections, extract_sections)['data'])


    return result

if __name__ == "__main__":
    a,e = get_extraction_results('/Users/hoyo/PycharmProjects/judicial_document_proofreading/enetity_extraction/0725_test_data/25-何正华与王松民间借贷纠纷一审民事案102334654.txt')
    r = why_rule_check(a, e)
    print(r)
    pass